@use "sass:map";

.clear-buttom{
  border: none;
  background-color: transparent;
  font-size: inherit;
  padding: 0;
  margin: 0;
  line-height: inherit;
  color: inherit;
  &:after{
    display: none;
  }
  &.button-hover{
    background-color: transparent;
    color: inherit;
  }
}


$colors: () !default;
$jblist: "jb"; // 渐变需要防止在这里面
$colors: map.deep-merge(
  (
    "jb-base": (
      "base": linear-gradient(to left, $base, darken($base, 15%)),
      "bdcolor": $base,
    ),
    "jb-base2": (
      "base": linear-gradient(to bottom, $base, darken($base, 15%)),
      "bdcolor": $base,
    ),
    "jb-1": (
      "base": linear-gradient(to left, #155bda, #5893fe),
    ),
    "jb-2": (
      "base": linear-gradient(to left, red, #5893fe),
    ),
    "base": (
      "base": darken($base, 15%),
    ),
    "primary": (
      "base": #409eff,
    ),
    "success": (
      "base": #67c23a,
    ),
    "warning": (
      "base": #e6a23c,
    ),
    "danger": (
      "base": #f56c6c,
    ),
    "error": (
      "base": #f56c6c,
    ),
    "info": (
      "base": #909399,
    ),
  ),
  $colors
);
@function colors($name, $type) {
  $type: "base" !default;
  @if not map.has-key($colors, $name, $type) {
    @warn "没有找到`#{$name}` in $colors map. 请检查.";
  }
  @return map.get($colors, $name, $type);
}
button,
uni-button {
  &.flex-btn{
    display: flex;
    justify-content: center;
    align-items: center;
    line-height: 1;
    
  }
  font-size: 16px;
  &.w100 {
    width: 100%;
  }
  &.h100{
    height: 100%;
  }
  &[data-radius] {
    border-radius: 50px;
    &:after {
      border-radius: 50px;
    }
  }
  &[size="small"] {
    display: inline-block;
    line-height: 2;
    font-size: 28rpx;
    padding: 5rpx 30rpx;
  }
  &[size="mini1"] {
    display: inline-block;
    line-height: 2;
    font-size: 24rpx;
    padding: 2rpx 20rpx;
  }
  &[size="large"] {
    line-height: 2.8;
    font-size: 20px;
    padding: 5rpx 30rpx;
  }
  &[data-link] {
    &:not([type]) {
      color: #333;
    }
  }
  &[disabled]{
    opacity: .8;
  }
  &[data-shadow] {
    box-shadow: 0 0 15rpx rgba($color: #000000, $alpha: 0.05);
  }
}
button,
uni-button {


  @each $item, $social-color in $colors {
    $color: #fff !default;
    @if map-has-key($colors, $item, "color") {
      $color: colors($item, "color");
    }

    &[type="#{$item}"] {
      @if str-index(#{$item}, "jb") != null {
        background-image: colors($item, "base");
      } @else {
        background-color: colors($item, "base");
      }
      color: $color;
      @if map-has-key($colors, $item, "bdcolor") {
        border-color: colors($item, "bdcolor");
        &:after {
          border-color: colors($item, "bdcolor");
        }
      } @else {
        border-color: colors($item, "base");
      }
    }
    &[data-link][type="#{$item}"] {
      background-color: transparent !important;
      color: colors($item, "base") !important;
      border: none;

      &:after {
        display: none;
      }
    }
  }
}
